<html>
<head><meta charset="utf-8"><title>SAFETY comments tidyness · general · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/index.html">general</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/SAFETY.20comments.20tidyness.html">SAFETY comments tidyness</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="206621528"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/SAFETY%20comments%20tidyness/near/206621528" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Poliorcetics <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/SAFETY.20comments.20tidyness.html#206621528">(Aug 11 2020 at 19:41)</a>:</h4>
<p>That has bitten me a few time: a comment that has the following form:</p>
<div class="codehilite"><pre><span></span><code><span class="c1">// SAFETY:</span>
<span class="c1">//</span>
<span class="c1">// - first part</span>
<span class="c1">// - second part</span>
</code></pre></div>


<p>Will not pass the tidy checks when contributing to rust-lang/rust, is it a bug or expected behaviour ?</p>



<a name="206621617"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/SAFETY%20comments%20tidyness/near/206621617" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Poliorcetics <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/SAFETY.20comments.20tidyness.html#206621617">(Aug 11 2020 at 19:42)</a>:</h4>
<p>Any time <code>// SAFETY:</code> is its own line it fails in my experience</p>



<a name="206621702"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/SAFETY%20comments%20tidyness/near/206621702" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Poliorcetics <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/SAFETY.20comments.20tidyness.html#206621702">(Aug 11 2020 at 19:43)</a>:</h4>
<p>Example: in <a href="https://github.com/rust-lang/rust/issues/75066">#75066</a> I had to add some redondant text for it to pass because using a list was clearer</p>



<a name="206621879"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/SAFETY%20comments%20tidyness/near/206621879" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/SAFETY.20comments.20tidyness.html#206621879">(Aug 11 2020 at 19:44)</a>:</h4>
<p>we're probably overzealous in the tidy check</p>



<a name="206621922"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/SAFETY%20comments%20tidyness/near/206621922" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/SAFETY.20comments.20tidyness.html#206621922">(Aug 11 2020 at 19:44)</a>:</h4>
<p>we should probably just be checking that there's SAFETY somewhere above any unsafe block</p>



<a name="206621991"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/SAFETY%20comments%20tidyness/near/206621991" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Poliorcetics <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/SAFETY.20comments.20tidyness.html#206621991">(Aug 11 2020 at 19:45)</a>:</h4>
<p>I'm okay with requiring the whole comment to have more text than just <code>// SAFETY:</code>, that seems completely reasonable</p>



<a name="206622045"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/SAFETY%20comments%20tidyness/near/206622045" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/SAFETY.20comments.20tidyness.html#206622045">(Aug 11 2020 at 19:46)</a>:</h4>
<p>I <em>really</em> don't want tidy to become a full fledged parser</p>



<a name="206622068"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/SAFETY%20comments%20tidyness/near/206622068" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Poliorcetics <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/SAFETY.20comments.20tidyness.html#206622068">(Aug 11 2020 at 19:46)</a>:</h4>
<p>I understand ^^</p>



<a name="206622089"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/SAFETY%20comments%20tidyness/near/206622089" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/SAFETY.20comments.20tidyness.html#206622089">(Aug 11 2020 at 19:46)</a>:</h4>
<p>there's no reason for the check to be anything stricter than just "probably not an accident"</p>



<a name="206622165"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/SAFETY%20comments%20tidyness/near/206622165" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Poliorcetics <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/SAFETY.20comments.20tidyness.html#206622165">(Aug 11 2020 at 19:47)</a>:</h4>
<p>It's not used as a public tool, is it ?</p>



<a name="206622286"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/SAFETY%20comments%20tidyness/near/206622286" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Poliorcetics <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/SAFETY.20comments.20tidyness.html#206622286">(Aug 11 2020 at 19:48)</a>:</h4>
<p>I don't remember ever using it outside of rust-lang/rust but I'm not sure</p>



<a name="206622332"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/SAFETY%20comments%20tidyness/near/206622332" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/SAFETY.20comments.20tidyness.html#206622332">(Aug 11 2020 at 19:49)</a>:</h4>
<p>no it is entirely internal</p>



<a name="206622509"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/SAFETY%20comments%20tidyness/near/206622509" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Poliorcetics <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/SAFETY.20comments.20tidyness.html#206622509">(Aug 11 2020 at 19:50)</a>:</h4>
<p>Would a PR to change that behaviour be accepted ?</p>



<a name="206622527"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/SAFETY%20comments%20tidyness/near/206622527" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/SAFETY.20comments.20tidyness.html#206622527">(Aug 11 2020 at 19:50)</a>:</h4>
<p>yes, generally speaking</p>



<a name="206622553"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/SAFETY%20comments%20tidyness/near/206622553" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Poliorcetics <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/SAFETY.20comments.20tidyness.html#206622553">(Aug 11 2020 at 19:51)</a>:</h4>
<p>I have never looked at tidy's code but I could try to wip up something today</p>



<a name="206623374"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/SAFETY%20comments%20tidyness/near/206623374" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Poliorcetics <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/SAFETY.20comments.20tidyness.html#206623374">(Aug 11 2020 at 19:57)</a>:</h4>
<p>Ok this is literally a two spaces change ^^</p>



<a name="206624459"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/SAFETY%20comments%20tidyness/near/206624459" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Poliorcetics <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/SAFETY.20comments.20tidyness.html#206624459">(Aug 11 2020 at 20:05)</a>:</h4>
<p>Done: <a href="https://github.com/rust-lang/rust/issues/75422">#75422</a></p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>